﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using CustomControlLibrary;

namespace StoreWinform
{
    public partial class TestForm : Form
    {
        public TestForm()
        {
            InitializeComponent();
        }

        private void stmButton1_Click(object sender, EventArgs e)
        {
            StmProcessBar stmProcessBar = StmProcessBar.Instance;
            Thread backgroundThread = new Thread(
                new ThreadStart(() =>
                {
                    Thread.Sleep(5000);

                    if (stmProcessBar.InvokeRequired)
                        stmProcessBar.BeginInvoke(new Action(() => stmProcessBar.Close()));
                }
            ));
            backgroundThread.Start();
            stmProcessBar.ShowDialog();
        }
    }
}
